package com.niguang.work.api.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableLogic;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 'work.v_personSite' is not BASE TABLE
 * </p>
 *
 * @author 12380
 * @since 2018-09-06
 */
@TableName("work_reform_user")
@Data
public class ReformUser extends Model<ReformUser> {

    private static final long serialVersionUID = 1L;

    private Long id;
    /**
     * 工地ID
     */
    private Long siteId;
    private String userId;
    /**
     * 用户姓名
     */
    private String userName;
    /**
     * 手机号码
     */
    private String userPhone;
    /**
     * 工作职位
     */
    private String jobPosition;
    /**
     * 1--整改人 2--审核人
     */
    private Integer roleType = 0;
    /**
     * 微信unionId
     */
    private String unionId;
    /**
     * 微信服务号openId
     */
    private String openId;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 删除标识 0-未删除 1-已删除
     */
    @TableLogic
    private Integer delFlag;

    public ReformUser() {
    }

    public ReformUser(String unionId, String openId) {
        this.unionId = unionId;
        this.openId = openId;
    }

    public static final String ID = "id";

    public static final String SITE_ID = "site_id";

    public static final String USER_ID = "user_id";

    public static final String USER_NAME = "user_name";

    public static final String USER_PHONE = "user_phone";

    public static final String JOB_POSITION = "job_position";

    public static final String ROLE_TYPE = "role_type";

    public static final String UNION_ID = "union_id";

    public static final String OPEN_ID = "open_id";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String DEL_FLAG = "del_flag";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "ReformUser{" +
                "id=" + id +
                ", siteId=" + siteId +
                ", userId=" + userId +
                ", userName=" + userName +
                ", userPhone=" + userPhone +
                ", jobPosition=" + jobPosition +
                ", roleType=" + roleType +
                ", unionId=" + unionId +
                ", openId=" + openId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", delFlag=" + delFlag +
                "}";
    }
}
